package com.example.mapp;

import com.example.entity.AcceptanceResult;
import org.apache.ibatis.annotations.*;

/**
 * Created by youkun on 2017/9/22.
 */
@Mapper
public interface AcceptanceResultMapp {

    @Select(" select * from acceptance_result  where id=#{id}")
    AcceptanceResult queryById(String id) throws Exception;

    @Update(" update acceptance_result set " +
            " ins_id=#{insId},accept_user_sign=#{acceptUserSign},accept_date_time=#{acceptDateTime} " +
            " basis=#{basis},basis1=#{basis1},cantact_phone=#{cantactPhone},cantact_phone1=#{cantactPhone1}"+
            " charge_num=#{chargeNum},charge_price=#{chargePrice}"+
            " where id=#{id} ")
    public int update(AcceptanceResult acceptanceResult) throws Exception;

    @Delete(" delete from acceptance_result where id=#{id} ")
    public int delete(String id) throws Exception;

    @Insert(" insert into acceptance_result " +
            "(ins_id,accept_user_sign,accept_date_Time,report_sup_org_date,sup_org_opinion,out_date_ins,uncheck_in_date,report_sup_num,other,charge_num," +
            "charge_price,received_date,is_pass,check_option_num,fault_user_report,wait,no_salf_check,no_maint_user,basis,check_date,user_sign,cantact_phone," +
            "sign_date,used_sign,used_user_phone,used_sign_date,is_pass1,check_option_num1,fault_user_report1,wait1,no_salf_check1,no_maint_user1,basis1,check_date1," +
            "user_sign1,cantact_phone1,sign_date1,used_sign1,used_user_phone1,used_sign_date1,enclosure_urls) " +
            " value (#{insId},#{acceptUserSign}, #{acceptDateTime},#{reportSupOrgDate},#{supOrgOpinion},#{outDateIns}," +
            "#{uncheckInDate},#{reportSupNum},#{other},#{chargeNum},#{chargePrice},#{receivedDate},#{isPass},#{checkOptionNum}," +
            "#{faultUserReport},#{wait},#{noSalfCheck},#{noMaintUser},#{basis},#{checkDate},#{userSign},#{cantactPhone},#{signDate}," +
            "#{usedSign},#{usedUserPhone},#{usedSignDate},#{isPass1},#{checkOptionNum1},#{faultUserReport1},#{wait1},#{noSalfCheck1},#{noMaintUser1}," +
            "#{basis1},#{checkDate1},#{userSign1},#{cantactPhone1},#{signDate1},#{usedSign1},#{usedUserPhone1},#{usedSignDate1},#{enclosureUrls}) ")
    @SelectKey(statement="select last_insert_id()",keyProperty = "id",keyColumn = "id",before = false,resultType = Long.class)
    public int add(AcceptanceResult acceptanceResult) throws Exception;
}
